<?php
$uin=empty($_GET['uin'])?exit('Error!'):$_GET['uin'];
function getquesig($uin)
{
	$ch=curl_init('http://captcha.qq.com/getQueSig?aid=549000929&uin='.$uin.'&captype=3&0.360241'.time());
	curl_setopt($ch, CURLOPT_HEADER, TRUE);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Linux; U; Android 4.0.4; es-mx; HTC_One_X Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0');
    //curl_setopt($ch, CURLOPT_REFERER, "");
    $data = curl_exec($ch);
    curl_close($ch);
	if(preg_match_all('/Set-Cookie:(.*);/iU', $data, $cookie)){//有cookies返回
		/*foreach($cookie[1] as $value){
			$rel.=$value."<br/>";
		}*/
	}
    if(preg_match("/cap_getCapBySig\(\"(.*?)\"\);/", $data, $arr)){
		return $arr[1];
	}else{
		return false;
	}
}
echo getquesig($uin);

?>